[IA64] Fix thash_init()
authorawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Tue, 20 Mar 2007 15:16:09 +0000 (09:16 -0600)
committerawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Tue, 20 Mar 2007 15:16:09 +0000 (09:16 -0600)
Lost initializating page_flag of the last member in cch.

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
xen/arch/ia64/vmx/vtlb.c

index 7ed628ba66db1a9548d15978a6b5b649bd495a5f..3b6c5377b7b26e60b3b77a9119e1c6ca886b7058 100644 (file)
@@ -642,7 +642,7 @@ void thash_init(thash_cb_t *hcb, u64 sz)
     }while(num);
     
     hcb->cch_freelist = p = hcb->cch_buf;
-    num = (hcb->cch_sz/sizeof(thash_data_t))-1;
+    num = hcb->cch_sz / sizeof(thash_data_t);
     do{
         p->page_flags = 0;
         p->itir = 0;
@@ -650,6 +650,6 @@ void thash_init(thash_cb_t *hcb, u64 sz)
         p++;
         num--;
     }while(num);
-    p->itir = 0;
-    p->next = NULL;
+
+    (p - 1)->next = NULL;
 }